﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading;

//namespace SkypeBot.Core.Commands
//{
//    class SpamCommand : IMessageHandler
//    {
//        static Thread objWorker;

//        [MessageAttribute(@"^!spam (?<reciverName>\w*) (?<spamMessage>\w.*)$")]
//        public Responce Spam(Message message, string reciverName, string spamMessage)
//        {
//            foreach (var user in Core.Instance.Users)
//            {
//                if (((SKYPE4COMLib.User)user).Handle == reciverName)
//                {
//                    objWorker = new Thread(StartSpam);
//                    Receiver mobjReceiver = new Receiver(reciverName, false);
//                    var mobjArgs = new Responce(mobjReceiver, spamMessage);
//                    objWorker.Start(mobjArgs);
//                }
//            }
//            return null;
//        }

//        public void StartSpam(object args)
//        {
//            int i = 0;
//            Responce objResponce = args as Responce;
//            while (i < 200)
//            {
//                Thread.Sleep(1000);
//                SkypeBotCore.Core.Instance.SendMessage(objResponce);
//                i++;
//            }
//        }

//        [MessageAttribute(@"^!stopspam$")]
//        public void StopSpam()
//        {
//            objWorker.Abort();
//        }
//    }
//}
